package com.woniu.service.impl;

import com.woniu.dao.OrderDao;
import com.woniu.dao.UserDao;
import com.woniu.service.DashboardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.*;

@Service
public class DashboardServiceImpl implements DashboardService {

    @Autowired
    private UserDao userDao;

    @Autowired
    private OrderDao orderDao;

    @Override
    public BigDecimal getTotalSales() {
        return orderDao.getTotalSales();
    }

    @Override
    public Long getOrderCount() {
        return orderDao.getOrderCount();
    }

    @Override
    public Long getPendingOrderCount() {
        return orderDao.getPendingOrderCount();
    }

    @Override
    public Long getPayingUserCount() {
        return orderDao.getPayingUserCount();
    }

    @Override
    public Long countPendingTeachers() {
        return userDao.countPendingTeachers();
    }

    @Override
    public Long countNewUsers() {
        return userDao.countNewUsers();
    }

    @Override
    public List<Map<String, Object>> getYesterdayPaymentTrend() {
        return orderDao.getYesterdayPaymentTrend();
    }
}
